
<#include "/common/head.html"/>


 <div class="easyui-panel addPage" data-options="fit:true,border:false,novalidate:true">
    <form class="easyui-form" id="ff" method="post" data-options="novalidate:true">
        <table class="table1">
            <tr>
           		<th><span id="uname_label">用户名：</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="uname" id="uname" value="" data-options="fit: true,required:true"></input></div>
           		</td>
            <tr>
           		<th><span id="passwd_label">密码：</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="passwd" id="passwd" value="" data-options="fit: true,required:true"></input></div>
           		</td>
            </tr>
            <tr>
           		<th><span id="pic_label">头像：</span></th>
               	<td>
			        <div class="wrap_input"><input class="easyui-filebox" type="text" name="pic" id="pic" data-options="fit: true,required:true,buttonText: '选择图片', accept1: 'image/*', onChange: function(){uploadFile('pic')}"></input></div>
					<div class="image_pre"><img id="picImg" src=""></div>
           		</td>
            </tr>
            <tr>
           		<th><span id="realname_label">姓名：</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="realname" id="realname" value="" data-options="fit: true"></input></div>
           		</td>
            </tr>
            <tr>
           		<th><span id="idcard_label">身份证号：</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="idcard" id="idcard" value="" data-options="fit: true,required:true"></input></div>
           		</td>
            </tr>
            <tr>
           		<th><span id="phone_label">手机号码：</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="phone" id="phone" value="" data-options="fit: true,required:true"></input></div>
           		</td>
            </tr>
            <tr>
           		<th><span id="level_label">等级：</span></th>
               	<td>
	            	<div class="wrap_input"><input class="easyui-combobox" id="level" name="level" value="" data-options="
	            				valueField: 'id',
   								textField: 'text',
   								fit: true,
	            				data: [
	            					{id:'', text:''}<#list dictDatalevel.keySet() as key>,{id:'${key}', text:'${dictDatalevel.get(key)}'}</#list>
	            				]
	            				,required:true
	            	" /></div>        	
           		</td>
            </tr>
        </table>
    </form>
</div>
<script>

top.window.subPage.save = save;
function save() {
	if($("#ff").form('enableValidation').form('validate')) {
		$.post("add", getParam(), function(data) {
			if(data.result == "success") {
				top.window.closeWindow();
				top.window.subPage.loadCurrDatagrid();
			}
		});
	}
}
function getParam() {
	var param = {
	     
       		"model.uname": getInputValue("uname"), 
       		"model.passwd": getInputValue("passwd"), 
       		"model.pic": getInputValue("pic"), 
       		"model.realname": getInputValue("realname"), 
       		"model.idcard": getInputValue("idcard"), 
       		"model.phone": getInputValue("phone"), 
       		"model.level": getInputValue("level"), 
	}
	for(key in param) {
		if(!param[key]) {
			delete param[key];
		}
	}
	return param;
}

//扩展js
</script>
<#include "/common/foot.html"/>
